package com.song.day06.ch6_8;

public class Main {
	
	
	public static void main(String[] args) {
		
		Account account = new Account();
		account.setBalance(1000);
		
		Company company = new Company(account);
		Thread cthread = new Thread(company);
		
		Bank bank = new Bank(account);
		Thread bthread = new Thread(bank);
		System.out.printf(" Account ： initial  balance is %d\n",account.getBalance());
		cthread.start();
		bthread.start();
		
		
		try {
			cthread.join();
			bthread.join();
			System.out.printf(" Account ： Final  balance is %d\n",account.getBalance());
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}
